package net.stock.service;

import javax.jdo.PersistenceManagerFactory;
import javax.jdo.PersistenceManager;

/**
 * @author naim
 * @date Dec 30, 2009
 *
 * GAE does not allow to use Spring-orm
 */
public class JdoDaoSupport {
    protected PersistenceManagerFactory persistenceManagerFactory;

    public void setPersistenceManagerFactory(PersistenceManagerFactory persistenceManagerFactory) {
        this.persistenceManagerFactory = persistenceManagerFactory;
    }

    public PersistenceManager getPersistenceManager() {
        return persistenceManagerFactory.getPersistenceManager();
    }

    public void releasePersistenceManager(PersistenceManager pm) {
        pm.close();
    }
}
